Add `libtest_cleanup_gpg()` to the array of commands to run when
exiting. This provides 2 improvements:
1. You don't need to worry about whether the test will spawn a gpg-agent
and therefore require adding a call to `libtest_cleanup_gpg()`.
2. All the existing users were calling `libtest_cleanup_gpg()` at the
end of the script. If there was a failure and the script exited
early, then it wouldn't cleanup and there may be a stray gpg-agent
hanging around.
Closes: #1799
Approved by: cgwalters
local gpg_homedir=${1:-${test_tmpdir}/gpghome}
gpg-connect-agent --homedir "${gpg_homedir}" killagent /bye || true
}
+libtest_exit_cmds+=(libtest_cleanup_gpg)
is_bare_user_only_repo () {
grep -q 'mode=bare-user-only' $1/config
echo "ok pull sig deleted"
rm -rf repo gnomerepo-files
-libtest_cleanup_gpg
assert_not_reached
fi
-libtest_cleanup_gpg
-
echo "ok"
# Remaining tests require gpg
# assert_file_has_content deltas.txt "${origmain}-${newmain}"
# echo "ok pull mirror with signed summary covering static deltas"
-
-libtest_cleanup_gpg
cmp repo/tmp/cache/summaries/origin.sig ${test_tmpdir}/ostree-srv/gnomerepo/summary.sig.2 >&2
echo "ok pull with signed summary broken cache"
-
-libtest_cleanup_gpg
${OSTREE} pull --require-static-deltas R1:main
echo "ok gpg trusted signed commit for delta upgrades"
-
-libtest_cleanup_gpg
assert_file_has_content_literal raw-summary.txt "('other', ("
assert_file_has_content_literal raw-summary.txt "{'ostree.summary.last-modified': <uint64"
echo "ok view summary raw"
-
-libtest_cleanup_gpg